import { Plugin } from "../../core";
import { ReactElement } from "react";

// -------------------
// Render current page
// -------------------

export interface RenderCurrentPageLabelProps {
  currentPage: number;
  numberOfPages: number;
}

export interface CurrentPageLabelProps {
  children?: (props: RenderCurrentPageLabelProps) => ReactElement;
}

// -------------------------------------
// Page navigation
// -------------------------------------

export interface GoToPageMenuItemProps {
  onClick: () => void;
}

export interface RenderGoToPageProps {
  isDisabled: boolean;
  onClick: () => void;
}

export type RenderGoToPage = (props: RenderGoToPageProps) => ReactElement;

export interface GoToPageProps {
  children?: RenderGoToPage;
}

// ------
// Plugin
// ------

export interface PageNavigationPlugin extends Plugin {
  jumpToPage: (pageIndex: number) => void;
  CurrentPageInput: () => ReactElement;
  CurrentPageLabel: (props: CurrentPageLabelProps) => ReactElement;
  GoToFirstPage: (props: GoToPageProps) => ReactElement;
  GoToFirstPageButton: () => ReactElement;
  GoToFirstPageMenuItem: (props: GoToPageMenuItemProps) => ReactElement;
  GoToLastPage: (props: GoToPageProps) => ReactElement;
  GoToLastPageButton: () => ReactElement;
  GoToLastPageMenuItem: (props: GoToPageMenuItemProps) => ReactElement;
  GoToNextPage: (props: GoToPageProps) => ReactElement;
  GoToNextPageButton: () => ReactElement;
  GoToNextPageMenuItem: (props: GoToPageMenuItemProps) => ReactElement;
  GoToPreviousPage: (props: GoToPageProps) => ReactElement;
  GoToPreviousPageButton: () => ReactElement;
  GoToPreviousPageMenuItem: (props: GoToPageMenuItemProps) => ReactElement;
}
